package com.wswy.wyjk.ui.dialog;

import android.app.Dialog;
import android.content.Context;
import android.view.Display;
import android.view.LayoutInflater;
import android.view.View;
import android.view.WindowManager;
import android.widget.TextView;

import com.wswy.wyjk.R;


/**
 * Author:guohaijin
 * Date:
 * Description:
 */
public class SettingSubjectUpdateDialog {
    private Context context;
    private Dialog dialog;
    private Display display;


    public SettingSubjectUpdateDialog(Context context) {
        this.context = context;
        WindowManager windowManager = (WindowManager) context
                .getSystemService(Context.WINDOW_SERVICE);
        display = windowManager.getDefaultDisplay();
    }

    public SettingSubjectUpdateDialog builder() {
        // 获取Dialog布局
        View view = LayoutInflater.from(context).inflate(
                R.layout.dialog_setting_subject, null);

        TextView tvKnow = view.findViewById(R.id.tv_know);
        tvKnow.setOnClickListener(v->dialog.dismiss());

        // 定义Dialog布局和参数
        dialog = new Dialog(context, R.style.AlertDialogStyle);
        dialog.setContentView(view);

        return this;
    }


    private void setLayout() {
    }

    public void show() {
        setLayout();
        dialog.show();
    }
}
